package cn.jolyoulu.adminweb.entity.vo;

import lombok.Data;
import lombok.experimental.Accessors;
import cn.jolyoulu.cmnservice.entity.po.SysLoginLog;

import java.time.LocalDateTime;
import java.util.Objects;


@Data
@Accessors(chain = true)
public class SysLoginLogVO {

    /** id */
    private String id;

    /** 用户账号 */
    private String account;

    /** 登录状态（0=成功,1=失败） */
    private Integer status;

    /** 登录IP地址 */
    private String ipaddr;

    /** 登录地点 */
    private String loginLocation;

    /** 浏览器 */
    private String browser;

    /** 操作系统 */
    private String os;

    /** 提示消息 */
    private String msg;

    /** 访问时间 */
    private LocalDateTime loginTime;

	public SysLoginLogVO(SysLoginLog sysLoginLog) {
        if (Objects.nonNull(sysLoginLog)){
            this.id = String.valueOf(sysLoginLog.getId());
            this.account = sysLoginLog.getAccount();
            this.status = sysLoginLog.getStatus();
            this.ipaddr = sysLoginLog.getIpaddr();
            this.loginLocation = sysLoginLog.getLoginLocation();
            this.browser = sysLoginLog.getBrowser();
            this.os = sysLoginLog.getOs();
            this.msg = sysLoginLog.getMsg();
            this.loginTime = sysLoginLog.getLoginTime();
        }
    }
	
}